//
//  RFATree.h
//  RFA Manager
//
//  Created by Torsten Kammer on 23.02.08.
//  Copyright 2008 Ferroequinologist.de. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@class RFAArchiveEntry;

@interface RFATreeNode : NSObject <NSCopying>
{
    BOOL isLeaf;
    NSMutableDictionary *children;
    RFAArchiveEntry *entry;
    NSString *path;
}

- (id)copyWithZone:(NSZone *)zone;

- (id)initAsRoot;
- (void)addArchiveEntry:(RFAArchiveEntry *)entry;

@property (readonly) BOOL isLeaf;
@property (readonly) NSArray *children;
@property (readonly) RFAArchiveEntry *entry;
@property (readonly) NSString *path;

@property (readonly) NSData *data;
@property (readonly) NSString *contents;
@property (readonly) NSImage *image;

@property (readonly) NSUInteger size;

- (RFATreeNode *)childWithName:(NSString *)name createIfNeeded:(BOOL)create;
- (RFATreeNode *)childWithPath:(NSString *)name createIfNeeded:(BOOL)create;

@end